window.onload = function() {

    //轮播图

    function slideshow() {
        var sedeshow = document.getElementById("sedeshow");
        var Oul = sedeshow.getElementsByTagName("ul")[0];
        var Ol = sedeshow.getElementsByTagName("ol")[0];

        var list = Oul.getElementsByTagName("li");
        var btns = Ol.getElementsByTagName("li");
        index = 0;

        Oul.style.width = list.length * 412 + "px";

        var timer = null;

        function clearBtn() {
            for (var i = 0; i < btns.length; i++) {
                btns[i].className = "";
            }
            btns[this.index].className = "active";
        }
        timer = setInterval(fun1, 2000);

        function fun1() {
            if (index >= list.length - 1) {
                index = 0;
            } else {
                index++;
            }
            clearBtn();
            Oul.style.left = index * -412 + "px";

        }




        for (var i = 0; i < btns.length; i++) {
            btns[i].index = i;
            btns[i].onclick = function() {
                for (var j = 0; j < btns.length; j++) {
                    btns[j].className = "";
                }
                this.className = "active";
                Oul.style.left = this.index * -412 + "px";
            }

        }

        sedeshow.onmouseover = function() {
            clearInterval(timer);
        }
        sedeshow.onmouseout = function() {
            timer = setInterval(fun1, 2000);
        }







    }
    slideshow();









    //tab切换
    function For(c, d) {

        for (var i = 0; i < c.length; i++) {
            c[i].index = i;
            c[i].onmouseover = function(e) {
                for (var j = 0; j < c.length; j++) {
                    c[j].className = " ";
                    d[j].className = " ";

                }
                this.className = "active";
                d[this.index].className = "show";
            }
        }
    }

    function tab(a, b) {
        var aLi = document.getElementById(a).getElementsByTagName('p');
        var aDiv = document.getElementById(b).getElementsByTagName('div');
        For(aLi, aDiv)
    };






    tab("tab-tit", "tab-div");
    tab("tab-tit1", "tab-div1");
    tab("tab-tit2", "tab-div2");
    tab("tab-tit3", "tab-div3");
    tab("tab-tit4", "tab-div4");
    tab("tab-tit5", "tab-div5");
    tab("tab-tit6", "tab-div6");
    tab("tab-tit7", "tab-div7");
    tab("tab-tit8", "tab-div8");
    tab("tab-tit9", "tab-div9");
    tab("tab-tit10", "tab-div10");
    tab("tab-tit11", "tab-div11");
    tab("tab-tit12", "tab-div12");
    tab("tab-tit13", "tab-div13");
    tab("tab-tit14", "tab-div14");
    tab("tab-tit15", "tab-div15");











































































}